package com.seqb.manage;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpSession;

/**
 * @author lilinshen
 * @title 请填写标题
 * @description 请填写相关描述
 * @date 2021/4/30
 */
@RestController
public class TestController {

    @Value("${server.port}")
    Integer port;

    @GetMapping("/session/set")
    public String set(HttpSession session) {
        session.setAttribute("user", "llsydn");
        return String.valueOf(port);
    }

    @GetMapping("/session/get")
    public String get(HttpSession session) {
        return session.getAttribute("user") + ":" + port;
    }
}
